28 #ifndef _spoton_smp_h_
29 #define _spoton_smp_h_
47 static const unsigned int BITS = 1536;
48 static gcry_mpi_t generateWeakRandomPrime(
bool *ok);
49 static void test1(
void);
50 static void test2(
void);
51 static void test3(
void);
52 static void test4(
void);
53 QByteArray guessSha(
void)
const;
54 QByteArray guessWhirlpool(
void)
const;
55 QList<QByteArray> coordinatesProof(
const gcry_mpi_t g2,
60 QList<QByteArray> equalLogs(
const gcry_mpi_t qab,
64 QList<QByteArray> logProof(
const gcry_mpi_t g,
68 QList<QByteArray> nextStep(
const QList<QByteArray> &other,
71 QList<QByteArray> step1(
bool *ok);
73 QString guessString(
void)
const
78 bool passed(
void)
const;
79 bool verifyCoordinatesProof(
const QList<QByteArray> &list,
84 const int version)
const;
85 bool verifyEqualLogs(
const QList<QByteArray> &list,
89 const int version)
const;
90 bool verifyLogProof(
const QList<QByteArray> &list,
93 const int version)
const;
96 void setGuess(
const QString &guess);
98 void setModulus(
const gcry_mpi_t modulus)
100 gcry_mpi_release(m_modulus);
101 m_modulus = gcry_mpi_copy(modulus);
110 QString m_guessString;
120 gcry_mpi_t m_generator;
122 gcry_mpi_t m_modulus;
129 size_t m_guessWhirlLength;
131 static const int TERMINAL_STATE = -1;
132 QList<QByteArray> step2(
const QList<QByteArray> &other,
bool *ok);
133 QList<QByteArray> step3(
const QList<QByteArray> &other,
bool *ok);
134 QList<QByteArray> step4(
const QList<QByteArray> &other,
137 gcry_mpi_t generateRandomExponent(
bool *ok)
const;
139 void step5(
const QList<QByteArray> &other,
bool *ok,
bool *passed);